﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;


namespace DLM.Data.EF.CodeFirst.Mapping
{
    public class TypeMap : EntityTypeConfiguration<DLM.Domain.Model.Type>
    {
        public TypeMap()
        {
            this.HasKey(t => t.PID);
            this.ToTable("PartyType");
            this.Property(t => t.PID).HasColumnName("PID");
            this.Property(t => t.Name).HasColumnName("Name").IsRequired().HasMaxLength(20);
            this.Property(t => t.PartyType).HasColumnName("Type");
        }
    }
}
